#导入又拍云操作类
from re import M
import upyun

class MyUpyun:
    def __init__(self):
        #实例化又拍云  '空间名称','操作员账号','操作员密码'
        self.up = upyun.UpYun('hxy12345','hxy12345','JBBTbNPyON2wITg9MnPC5ZCH6EKiAG2u')
    #创建目录
    def mkdir(self,id):
        self.up.mkdir('/'+str(id))

    #上传文件
    def upload(self,id,filename,path):
        with open(path,'rb') as f:          
            self.up.put('/'+str(id)+'/'+filename,f)

    def delete(self,id,filename):        
            self.up.delete('/'+str(id)+'/'+filename)
    
    

# myupyun= MyUpyun()
# myupyun.delete(43,'1 - 副本.png')


    





